package com.shell.provider;

import com.shell.governor.organization.po.PubOrgan;
import com.shell.governor.organization.service.PubOrganService;
import com.shell.governor.organization.vo.PubOrganVo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubOrganProvider {
	@Autowired
	private PubOrganService pubOrganService;

	@RequestMapping({ "/organ/saveOrUpdateOrganRecord" })
	public int saveOrUpdateOrganRecord(@RequestBody PubOrganVo organVo) {
		return this.pubOrganService.saveOrUpdateOrganRecord(organVo);
	}

	@RequestMapping({ "/organ/selectOne" })
	PubOrgan selectOne(@RequestBody PubOrgan parentOrgan) {
		return (PubOrgan) this.pubOrganService.selectOne(parentOrgan);
	}

	@RequestMapping({ "/organ/selectByEntity" })
	List<PubOrgan> selectByEntity(@RequestBody PubOrgan pubOrgan) {
		return this.pubOrganService.selectByEntity(pubOrgan);
	}

	@RequestMapping({ "/organ/selectByKey" })
	PubOrgan selectByKey(@RequestParam("id") String id) {
		return (PubOrgan) this.pubOrganService.selectByKey(id);
	}

	@RequestMapping(value = { "/organ/queryUserEnt" }, method = {
			org.springframework.web.bind.annotation.RequestMethod.GET })
	public List<PubOrganVo> queryUserEnt(@RequestParam("userId") String userId) {
		return this.pubOrganService.queryUserEnt(userId);
	}

	@RequestMapping({ "/organ/updateNotNull" })
	void updateNotNull(@RequestBody PubOrgan organ) {
		this.pubOrganService.updateNotNull(organ);
	}
}
